CREATE TABLE [dbo].[TMLETR_PROV]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_LETR_PROV] [dbo].[TD_VC_020] NOT NULL,
[FE_EMIS] [dbo].[TD_DT_001] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_VENC] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[CO_ESTA_DOCU] [dbo].[TD_VC_003] NOT NULL,
[CO_BANC] [dbo].[TD_VC_003] NULL,
[CO_AGEN] [dbo].[TD_VC_003] NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TMLETR_PR__FA_TI__28F7FFC9] DEFAULT ((1.000)),
[IM_TOTA] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMLETR_PR__IM_TO__29EC2402] DEFAULT ((0)),
[IM_PAGA] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMLETR_PR__IM_PA__2AE0483B] DEFAULT ((0)),
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[IM_APLI] [dbo].[TD_NU_015_006] NULL,
[ST_LETR_ADEL] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMLETR_PR__ST_LE__2BD46C74] DEFAULT ('N'),
[NO_ENDO] [dbo].[TD_VC_050] NULL,
[NU_RENO] [dbo].[TD_VC_008] NULL,
[NU_CANJ] [dbo].[TD_VC_008] NULL,
[FE_PROT] [dbo].[TD_DT_001] NULL,
[FE_PROG_PAGO] [dbo].[TD_DT_001] NULL,
[NO_AVAL] [dbo].[TD_VC_100] NULL,
[NO_DIRE_AVAL] [dbo].[TD_VC_100] NULL,
[NU_RUCC_AVAL] [dbo].[TD_VC_020] NULL,
[NU_TELE_AVAL] [dbo].[TD_VC_050] NULL,
[DE_LUGA_GIRO] [dbo].[TD_VC_050] NULL,
[NU_UNIC_BANC] [dbo].[TD_VC_050] NULL,
[DE_GLOS] [dbo].[TD_VC_100] NULL,
[NU_DIET] [dbo].[TD_VC_050] NULL,
[TI_PROV] [dbo].[TD_VC_003] NULL,
[NU_DEPO_DETR] [dbo].[TD_VC_020] NULL,
[FE_DEPO_DETR] [dbo].[TD_DT_001] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMLETR_PR__CO_US__2DBCB4E6] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMLETR_PR__FE_US__2EB0D91F] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMLETR_PR__CO_US__2FA4FD58] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMLETR_PR__FE_US__30992191] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMLETR_PROV] WITH NOCHECK ADD CONSTRAINT [CK__TMLETR_PR__ST_LE__2CC890AD] CHECK NOT FOR REPLICATION (([ST_LETR_ADEL]='N' OR [ST_LETR_ADEL]='S'))
GO
ALTER TABLE [dbo].[TMLETR_PROV] ADD CONSTRAINT [PK__TMLETR_P__EB5120FA5847EB8F] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_PROV], [NU_LETR_PROV]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMLETR_PROV] ADD CONSTRAINT [FK__TMLETR_PR__CO_EM__062EB1D0] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TMLETR_PROV] ADD CONSTRAINT [FK__TMLETR_PROV__0722D609] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
